﻿namespace HomeworkOppPartOne
{
    using System;
    
    class Call
    {
        private DateTime TimeMark { get; set; }
        public string CallerId { get; private set; }
        private double callDuration;

        internal Call()
        {
            this.TimeMark = DateTime.Now;
            this.CallerId = CallerId;
            this.CallDuration = callDuration;
        }

        internal Call(string callerId) :this()
        {
        }

        internal Call(string callerId, double callDuration)
            : this()
        {
        }

        internal double CallDuration
        {
            get{return this.callDuration;}
            private set
            {
                if (value < 0)
	            {
		            throw new ArgumentException("Invalid input!");
	            }
                this.callDuration = value;
            }
        }

        public override string ToString()
        {
            return string.Format("Caller: {0} Duration: {1} LogTime:{2}",this.CallerId,this.callDuration,this.TimeMark);
        }
    }
}
